﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _1041448_DH_Utilities
{
    public class Files
    {
        public static string ReadFile(string fName, out bool isReadSuccess){
            isReadSuccess = false;
            string source = string.Empty;

            if (fName == string.Empty){
                isReadSuccess = true;
                return string.Empty;
            }

            FileInfo mFile = new FileInfo(fName);

            if (!mFile.Exists)
            {
                isReadSuccess = true;
                return string.Empty;
            }

            FileStream fStream  = mFile.Open(FileMode.Open, FileAccess.Read);
            StreamReader sStream = new StreamReader(fStream);

            while (!sStream.EndOfStream)
            {
                source += sStream.ReadLine();
            }

            sStream.Close();
            fStream.Close();

            return source;
        }

        public static bool SaveFile(string fName, string source){
            bool result = true;



            return result;
        }
    }
}
